<?php
// get all types by group & module
$source_messages = SourceMessage::getTranslatedMessagesWithTypes($lang, $group, $module);
if (count($source_messages) > 0) :
?>
    <div class="group group-<?php echo $group; ?>">
        <div class="module module-<?php echo $module; ?>">
            <?php foreach($source_messages as $index_type => $sourceMessagesList) : ?>    
                <div class="type type-<?php echo $index_type; ?>">
                    <div class="form-group-heading"><?php if ($index_type!='') echo $index_type; else echo 'Common'; ?></div>
                    <?php foreach($sourceMessagesList as $source_id => $msgInfo) : ?>
                    <div class="row">
                        <label><?php echo $msgInfo['source']; ?></label>
                        <?php echo CHtml::textField('SourceMessage[records_list]['.$group.']['.$module.']['.$index_type.']['.$source_id.']',$msgInfo['translation'],array('style'=>'width:600px;')); ?>
                    </div>
                    <?php endforeach; ?>
                </div>    
            <?php endforeach; ?>
        </div>
    </div>
<?php endif; ?>